package com.jf.springboot.config;

import com.jf.springboot.bean.Student;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Scope;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-11-26
 * Time:14:12
 */
@Configuration
@ImportResource(locations = {"classpath:beans.xml"})
public class BeanConfig {
    //@Bean(name = "stu01")
    @Bean
    @Scope("prototype")
    public Student student01() {
        Student student = new Student();
        student.setId(10);
        student.setName("jack");
        student.setAge(18);
        return student;
    }
}
